﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Common/Master/PopupDiv.master" AutoEventWireup="true" CodeBehind="PictureEdit.aspx.cs" Inherits="Jzy.Web.SiteAdmin.Picture.PictureEdit" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
    <style type="text/css">
        .style1
        {
            width: 90px;
            text-align: right;
            height: 30px;
        }
    </style>
    
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
    <div style="height:5px; line-height:5px;"></div>
    <asp:Panel ID="pnlMain" runat="server" Width="100%" style=" height:149px;">
        <table border="0" cellpadding="0" cellspacing="0" style="width: 100%;" align="center">
            <tr>
                <td class="style1">图片：
                </td>
                <td>
                    <asp:FileUpload ID="fileTitlePicture" runat="server" />
                    
                </td>
            </tr>
            <tr>
                <td class="style1">名称：
                </td>
                <td>
                    <asp:TextBox ID="Name" runat="server" CssClass="txt" Width="143px"></asp:TextBox>
                    &nbsp;排序： 
                    <asp:TextBox ID="Orders" runat="server" CssClass="txt" Width="40px"></asp:TextBox>
                    <asp:RegularExpressionValidator ID="RegularExpressionValidator1" runat="server" 
                        ControlToValidate="Orders" Display="None" ErrorMessage="数字格式不正确" 
                        SetFocusOnError="True" ValidationExpression="-?\d*"></asp:RegularExpressionValidator>
                </td>
            </tr>
            <tr>
                <td class="style1">链接：
                </td>
                <td>
                    <asp:TextBox ID="Source" runat="server" CssClass="txt" Width="255px"></asp:TextBox>
                </td>
            </tr>
            <tr>
                <td class="style1">描述：
                </td>
                <td>
                    <asp:TextBox ID="Summary" runat="server" CssClass="txt" Height="54px" 
                        TextMode="MultiLine" Width="255px"></asp:TextBox>
                </td>
            </tr>           
        </table>
    </asp:Panel>
     <div id="lblMessage"  style="display:none;text-align:center; line-height:149px;">正在提交数据，请稍候...</div>

     <asp:ValidationSummary ID="ValidationSummary1" runat="server" ShowMessageBox="True"
        ShowSummary="False" />
        
        <script type="text/javascript">

            var form = document.forms[0];

            function form_submit()
            {

                if (Page_IsValid)//判断验证控件是否全部通过验证
                {
                    window.setTimeout(function()
                    {
                        var btnSave = document.getElementById("<%=btnSave.ClientID %>");
                        document.getElementById("lblMessage").style.display = "";
                        document.getElementById("<%=pnlMain.ClientID %>").style.display = "none";
                        btnSave.onclick = function()
                        {
                            alert("正在提交数据，请不要重复提交");
                            return false;
                        }
                    }, 1);                  
                }
            }

            if (form.attachEvent)
            {
                form.attachEvent("onsubmit", form_submit);
            }
            else if (form.addEventListener)
            {
                form.addEventListener("submit", form_submit, false);
            }
        
</script>
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="ContentPlaceHolder2" runat="server">
 <asp:Button ID="btnSave" runat="server" Text="保存" OnClick="btnSave_Click" />
</asp:Content>

